<template>
  <div class="search">
    <div class="kaho-search-box-wrapper">
      <div class="kaho-search-box flex flex-vertical-center">
        <i class="icon-search"></i>
        <input type="text" class="kaho-input flex-1" placeholder="搜索歌曲、歌手">
        <i class="icon-dismiss"></i>
      </div>
    </div>
    <div class="kaho-scroll-box">
      <cube-scroll class="kaho-scroll" ref="scroll">
        <div class="hot-key">
          <h1 class="title">热门搜索</h1>
          <ul>
            <li class="item">
              <span>周杰伦</span>
            </li>
          </ul>
        </div>
        <div class="search-history">
          <h1 class="title">
            <span class="text">搜索历史</span>
            <span class="clear">
              <i class="icon-clear"></i>
            </span>
          </h1>
          <div class="search-list">
            <ul>
              <li class="search-item">
                <span class="text">夜曲</span>
                <span class="icon">
                  <i class="icon-delete"></i>
                </span>
              </li>
            </ul>
          </div>
        </div>        
      </cube-scroll>
    </div>
    
  </div>
</template>
<script>

export default {
  name: 'search'
}
</script>
<style scoped lang="stylus">
.kaho-search-box-wrapper{
  margin: 20px;

  .kaho-search-box{
    box-sizing: border-box;
    width: 100%;
    padding: 0 6px;
    height: 40px;
    background: #333;
    border-radius: 6px;

    .icon-search{
      font-size: 24px;
      color: #ffcd32;
    }

    .kaho-input{
      margin: 0 5px;
      line-height: 18px;
      background: #333;
      color: #fff;
      font-size: 14px;
      outline: 0;
    }

    .icon-dismiss{
      font-size: 16px;
      color: #e5e5e5;
    }
  }

  
}

.kaho-scroll-box{
  position: fixed;
  top: 178px;
  bottom: 0;
  width: 100%;

  .kaho-scroll{
    height: 100%;
    overflow: hidden;

    .hot-key {
      margin: 0 20px 20px;

      .title {
        margin-bottom: 20px;
        font-size: 14px;
        color: hsla(0,0%,100%,.5);
      }

      .item {
        display: inline-block;
        padding: 5px 10px;
        margin: 0 20px 10px 0;
        border-radius: 6px;
        background: #333;
        font-size: 14px;
        color: hsla(0,0%,100%,.3);
      }
    }

    .search-history {
      position: relative;
      margin: 0 20px;

      .title {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
        height: 40px;
        font-size: 14px;
        color: hsla(0,0%,100%,.5);

        .text {
          -webkit-box-flex: 1;
          -ms-flex: 1;
          flex: 1;
        }

        .clear {
          position: relative;

          .icon-clear {
            font-size: 14px;
            color: hsla(0,0%,100%,.3);
          }
        }
      }

      .search-list {
        .search-item {
          display: -webkit-box;
          display: -ms-flexbox;
          display: flex;
          -webkit-box-align: center;
          -ms-flex-align: center;
          align-items: center;
          height: 40px;
          overflow: hidden;

          .text {
            -webkit-box-flex: 1;
            -ms-flex: 1;
            flex: 1;
            color: hsla(0,0%,100%,.5);
          }

          .icon {
            position: relative;

            .icon-delete {
              font-size: 12px;
              color: hsla(0,0%,100%,.3);
            }
            
          }
        }
      }
    }
  }
}
</style>
